package com.telenav;

public class RGB {

	public int R;
	public int G;
	public int B;

	public RGB(int r, int g, int b) {
		this.R = r;
		this.G = g;
		this.B = b;
	}

	public int sub(RGB rgb) {
		return (Math.abs(R - rgb.R) + Math.abs(G - rgb.G) + Math.abs(B - rgb.B)) / 3;
	}

	public String toString() {
		return R + "," + G + "," + B;
	}

	public int hashCode() {
		return (R << 16) + (G << 8) + B;
	}
}
